﻿<!--#include file="../Inc/easp/easp.asp"-->
<!--#include file="../Inc/conn1.asp"-->
<!--#include file="../inc/checklogin.asp"-->
<!--#include file="../inc/easyide.asp"-->
<% CheckLogin("index.asp") %>
<%
	If Session("Authority")<>"0" Then
		Response.Write "<script type=""text/javascript"">top.location.href='../main.asp';</script>"
	end if			
	
	Dim u_id
	u_id = Easp.Get("uid")'获取用户ID
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Modify User</title>
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<link rel="stylesheet" type="text/css" href="../css/style.css" />
<script type="text/javascript">
	var StyleFile = "theme" + document.cookie.charAt(6) + ".css";
	document.writeln('<link rel="stylesheet" type="text/css" href="../css/' + StyleFile + '">');
</script>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="../css/ie-sucks.css" />
<![endif]-->
</head>
<body>
<div id="container">
	<div id="header">
    <div id="divAccount" style="float:right;">
        <a href="../user/account.asp" style="color:white">Account</a>&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="../inc/logout.asp" style="color:white">Logout</a>
      </div>
		<h2>Modify User</h2>
		<div id="topmenu">
			<ul>
				<li><a href="../main.asp">Home</a></li>
				<li><a href="../Country/index.asp">Country</a></li>
				<li><a href="../holiday/index.asp">Holiday</a></li>
				<li><a href="../Times/index.asp">Times</a></li>
				<li><a href="../wallboard/index.asp">WallBoard</a></li>
				<% 
				    If Session("Authority")="0" Then 
				        Response.Write("<li class=""current""><a href='#'>User</a></li>")
				    End if
				%>
				<li><% If Session("Passed")=true Then %><a href="../inc/logout.asp">Logout</a><% End If %></li>
			</ul>
		</div>
	</div>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li><a href="index.asp" class="goback">GoBack</a></li>
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="rightnow">
				<h3 class="reallynow"> 
					<span>Modify User</span> 					
					<br />
				</h3>				
					<form id="form" action="Modifyuser.asp" method="post">
				    <div id="box">
				    	<%
				    	      dim rsuser,username,auth,g_id
								    set rsuser = Easp.db.GetRecordBySql("select * from [user] where ID=" & u_id)
								    If not Easp.IsN(rsuser) Then
								    	g_id = rsuser("g_id")
								    	username = rsuser("Name")
								    	auth = rsuser("Authority")
								    end if
				    	%>
					    <table style="width:500px;text-align: center;margin:auto;">						    
						    <tbody>			
						    	<tr>
						    		<td>User Name:</td>
						        <td><%=username %></td>
						    	</tr>			    	
						      <tr>
						      	<td>Authority:</td>
						        <td>
								  <%					  
								    If auth = "1" then
						        	Easp.w "Read & Write"           				    
									  Else
           				    Easp.w "Read Only"
									  End If 
								  %>
						        </td>
						      </tr>
							  <tr>
							    <td>Group:</td>
								<td>
								    <%
								     Dim curgid
									   Dim rsgroup
									   Set rsgroup = Easp.db.GetRecordBySql("select * from [Group] where ID=" & g_id)'查询所有组
									   If Not Easp.IsN(rsgroup) Then
									     Easp.w rsgroup("GroupName")
									     curgid = rsgroup("ID")
									   End If
									   Easp.db.C(rsgroup)
									%>
								</td>
							  </tr>
						      <tr>
						      	<td>Dispatch Country:</td>
						      	<td>						      		
						      			<%
						      			  '添加国家列表
						      			  dim rs
						      			  set rs = Easp.db.GetRecordBySql("SELECT Country.y_id, Country.CountryName FROM Country INNER JOIN UserCountry ON Country.y_id = UserCountry.CountryID WHERE (([UserCountry].[UserID]=" & u_id & ")) ORDER BY Country.y_id")'显示所有国家
						      			  If not Easp.IsN(rs) Then
						      			  	dim icount
						      			  	icount = 0
						      			  	while not rs.eof
						      			  	  icount = icount + 1
						      			  	  Easp.wc icount & "、" & rs("CountryName") & "<br />"
						      			  	  rs.MoveNext()
						      			  	wend
						      			  End If
						      			  Easp.db.C(rs)
						      			%>
						      	</td>						      	
						      </tr>
						    </tbody>
						  </table>
						  <div id="pager">
						  </div>
						</div>
					</form>				
			</div>
		</div>
	</div>
	<!--#include file="../inc/footer.asp" -->
</div>
</body>
</html>

